package com.zyit.exception;

import com.fasterxml.jackson.databind.util.ExceptionUtil;
import com.zyit.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(Exception.class)
    public Result handleGlobalException(Exception e){
        log.error(e.getMessage());
        return new Result<>("500");
    }
}
